package cn.tedu.boot012.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BMIController {
    @RequestMapping("/bmi")
    @ResponseBody
    private String bmi(double height, double weight) {
        System.out.println("height = " + height + ", weight = " + weight);
        double bmi = weight / (height * height);
        if (bmi<17.5){
            return "太瘦了!";
        }
        if (bmi<24){
            return "身体健康!";
        }
        if (bmi<27){
            return "有点胖了!";
        }
        return "太胖了!";
    }
}
